#!/usr/bin/env perl

# extract a pattern from a line
# this can be used as a filter program.
# use as: 
#          /sbin/ifconfig | perl extract.pl

# ip address
my $regex_pattern = "inet addr:([0-9.]+) "; 

while(<>) {
    if ( $_ =~ /$regex_pattern/ ) {
	print "$1\n";
    }
}
